#!/bin/bash
while true; do
  TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
  PING_RESULT=$(ping -c 1 www.baidu.com | grep 'bytes from')
  echo "$TIMESTAMP - $PING_RESULT"
  sleep 1
done